Setting an Attribute

I want to apply this filter with show ancestors and descendants in all modules/folders ((CSCI Test ID is not empty) AND (Requirement == True)) and set a Temp attribute to "X" I have over 50 modules and don't want to go through each module with the view and set it manually. Is this possible?

Regards

Vikesh
vppatel - Fri Aug 05 12:29:12 EDT 2011

Re: Setting an Attribute
llandale - Fri Aug 05 13:34:41 EDT 2011

Huh?

You want to set a Temp object-attribute value to either "X" for qualifying objects or nothing, in 50 modules. A qualifying object is one with Requirement and CSCI. When an object qualifies then you want to also mark all its ancestor (heading) objects and all its subordinate lower level objects (if any). If so, I'd do something like this for a single module:
 

Skip skpQualify = create  // KEY and DATA both "Object" that qualifies
Skip skpMarks   = create  // KEY and DATA both "Object" that needs to be marked.
 
void MarkChildren(Object obj)
{   // RECURSIVELY mark this and all children objects
    if (null obj or isDeleted(obj)) return
    put(skpMarks, obj, obj)
    for oChild in obj do
    {  MarkChildren(oChild)   // ** RECURSION HERE
    }
}   // end MarkChildren()
 
// above would be global code.  Following would be inside the edited module code:
 
for obj in entire mod do
{  if (!isDeleted(obj) and object qualifies) put(skpQualify, obj, obj)
}
for obj in skpQualify do
{  put(skpMarks, obj, obj)
                // mark parents:
   oParent = parent(obj)
   while(!null oParent)
   {  put(skpMarks, oParent, oParent)
      oParent = parent(oParent)
   }
               // mark children
   MarkChildren(obj)
}
             // now mark:
for obj in entire mod do
{  if (find(skpMarks, obj)) //
   then obj."Temp" == "X"
   else obj."Temp" == ""
}
delete(skpMarks)
delete(skpQualifies)
save and close mod


Not sure that covers deleted objects perfectly. Maybe you want to include all deleted objects, but v9201 disallows modifying obj-attr values of deleted objects.

 

  • Louie

 

Re: Setting an Attribute
vppatel - Mon Aug 08 12:41:52 EDT 2011

llandale - Fri Aug 05 13:34:41 EDT 2011

Huh?

You want to set a Temp object-attribute value to either "X" for qualifying objects or nothing, in 50 modules. A qualifying object is one with Requirement and CSCI. When an object qualifies then you want to also mark all its ancestor (heading) objects and all its subordinate lower level objects (if any). If so, I'd do something like this for a single module:
 

Skip skpQualify = create  // KEY and DATA both "Object" that qualifies
Skip skpMarks   = create  // KEY and DATA both "Object" that needs to be marked.
 
void MarkChildren(Object obj)
{   // RECURSIVELY mark this and all children objects
    if (null obj or isDeleted(obj)) return
    put(skpMarks, obj, obj)
    for oChild in obj do
    {  MarkChildren(oChild)   // ** RECURSION HERE
    }
}   // end MarkChildren()
 
// above would be global code.  Following would be inside the edited module code:
 
for obj in entire mod do
{  if (!isDeleted(obj) and object qualifies) put(skpQualify, obj, obj)
}
for obj in skpQualify do
{  put(skpMarks, obj, obj)
                // mark parents:
   oParent = parent(obj)
   while(!null oParent)
   {  put(skpMarks, oParent, oParent)
      oParent = parent(oParent)
   }
               // mark children
   MarkChildren(obj)
}
             // now mark:
for obj in entire mod do
{  if (find(skpMarks, obj)) //
   then obj."Temp" == "X"
   else obj."Temp" == ""
}
delete(skpMarks)
delete(skpQualifies)
save and close mod


Not sure that covers deleted objects perfectly. Maybe you want to include all deleted objects, but v9201 disallows modifying obj-attr values of deleted objects.

 

  • Louie

 

Huh is exactly what I said when the users wanted that. Thanks for the help.

Re: Setting an Attribute
llandale - Mon Aug 08 17:46:35 EDT 2011

vppatel - Mon Aug 08 12:41:52 EDT 2011
Huh is exactly what I said when the users wanted that. Thanks for the help.

Is this what you were looking for? Notice I ignored your references to "filters" and "views" suspecting that's how non-DXL folks think about object selection.

  • Louie